<?php
	echo "<h1> ".$courses['title']." </h1>";
	
	echo '<p>'.$courses['longdesc'].'</p><br>';
	
	// Get Courses and resources
	$resources = $this->MCourse->getResourcesByCourse($courses['course_id']);
	if (count($resources)){
		echo '<table cellpadding="0" cellspacing="0" border="0" class="bordered-table zebra-striped" id="example">';
		echo "<thead><tr valign='top'>";
		echo "<th>Resource type</th><th>Resource</th><th>Semester</th><th>Shift</th><th>Group</th><th>Year</th><th>Download</th>";
		foreach ($resources as $key => $item){
			echo "<tr valign='top'>";
			echo "<td align='center'>".$item['file_type']."</td>";
			echo "<td align='center'>";
			echo "<a href='#'>".$item['file_src']."</a>";
			echo "</td>";
			echo "<td align='center'>".$item['semester']."</td>";
			echo "<td align='center'>".$item['shift']."</td>";
			echo "<td align='center'>".$item['group']."</td>";
			echo "<td align='center'>".$item['year']."</td>";
			echo "<td class='nofollow' align='center'>";
			echo form_open('lecturers/download');
			/*echo validation_errors();
			echo $cap_img.'<br />';
			$data = array('name'=>'captcha','id'=>'captcha','size'=>10);
			echo form_input($data);*/
			echo form_hidden('username', $item['username']);
			echo form_hidden('file_src', $item['file_src']);
			echo form_submit(array('class'=>'btn','name'=>'submit'),'Download');
			echo form_close();
			echo "</td>";
			echo "</tr>";
		}	
		echo '</table>';
	}
?>